<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../static/layui-master/dist/css/layui.css"  media="all">
    <style type="text/css">
        .layui-table-cell {
            height: auto;
            line-height: 20px;
        }
    </style>
</head>
<body>
<table class="layui-hide" id="test"></table>

<script src="../../../static/layui-master/dist/layui.js" charset="utf-8"></script>
<script>
    layui.use('table', function(){
        var table = layui.table;

        table.render({
            elem: '#test'
            ,url:'../../../api/classSchedule.json'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,cols: [[
                {field:'time', title: '时间', align: 'center'}
                ,{field:'Monday', title: '周一', align: 'center'} //width 支持：数字、百分比和不填写。你还可以通过 minWidth 参数局部定义当前单元格的最小宽度，layui 2.2.1 新增
                ,{field:'Tuesday', title: '周二', align: 'center'}
                ,{field:'Wednesday', title: '周三', align: 'center'}
                ,{field:'Thursday', title: '周四', align: 'center'}
                ,{field:'Friday', title: '周五', align: 'center'} //单元格内容水平居中
                ,{field:'Saturday', title: '周六', align: 'center'} //单元格内容水平居右
                ,{field:'Sunday', title: '周天', align: 'center'}
            ]]
        });
    });
</script>

</body>
</html>